package edu.hcmus.sow.domain.security;

import org.springframework.security.acls.domain.PrincipalSid;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.SpringSecurityCoreVersion;

public class CustomPrincipalSid extends PrincipalSid {

   private static final long serialVersionUID = SpringSecurityCoreVersion.SERIAL_VERSION_UID;

   public CustomPrincipalSid(String principal) {
      super(principal);
   }

   public CustomPrincipalSid(Authentication authentication) {
      this(String.valueOf(((CustomUser) authentication.getPrincipal()).getUserID()));
   }

}
